package com.conghuhu.handler.exception;

import com.conghuhu.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author conghuhu
 * @create 2021-09-24 20:45
 */
@RestControllerAdvice
public class GlobalExpection {

    @ExceptionHandler(value = Exception.class)
    public Result exception(Exception e){
        e.printStackTrace();
        return Result.fail("500","未知错误");
    }
}
